package com.firewolf.oa.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.firewolf.oa.base.impl.BaseDaoImpl;
import com.firewolf.oa.dao.DepartmentDao;
import com.firewolf.oa.entities.Department;

@Repository
public class DepartmentDaoImpl extends BaseDaoImpl<Department> implements DepartmentDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<Department> findTopDepartments() {
		return getSession().createQuery("FROM Department WHERE parent IS NULL").list(); //一级部门的parent是空的
	}

}
